/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.servidor;

import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

import com.dao.DAOHospede;
import com.dao.DAOHotel;
import com.dao.DAOQuarto;
import com.dao.DAOReserva;
import com.dao.DAOServidor;

/**
 *
 * @author andersonribeiro
 */
public class ServidorMain {

	final static String HOST_URL = "//localhost:6000/redehoteis";
	final static int port = 6000;

	/*DAOServidor daoServidor = new DAOServidor();
	DAOHotel daoHotel = new DAOHotel();
	DAOHospede daoHospede = new DAOHospede();
	DAOReserva daoReserva = new DAOReserva();
	DAOQuarto daoQuarto = new DAOQuarto();*/

	public ServidorMain() throws RemoteException, AlreadyBoundException, MalformedURLException {

		LocateRegistry.createRegistry(port);
		IServidor servidor = new Servidor();
		Naming.bind(HOST_URL, servidor);

		/*daoServidor.close();
		daoHotel.close();
		daoHospede.close();
		daoReserva.close();
		daoQuarto.close();*/

	}

	public static void main(String[] args) throws RemoteException, AlreadyBoundException, MalformedURLException {

		new ServidorMain();

	}
}
